package org.skipper.common;

/**
 * Created with IntelliJ IDEA.
 * Description:
 *
 * @author shoujian
 * Date: 2022-08-17
 * Time: 16:30
 */
public class Response extends DTO {

    private static final long serialVersionUID = 3832152694532280109L;

    /**
     * 返回码： 0表示成功，其余表示失败（参照ReturnResultCode）
     */
    private String code;

    /**
     * 错误描述
     */
    private String message;

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }


    public static Response createErrorMsg(String code) {
        Response response = new Response();
        response.setCode(code);
        return response;
    }

    public static Response createErrorMsg(String code, String message) {
        Response response = new Response();
        response.setCode(code);
        response.setMessage(message);
        return response;
    }


    @Override
    public String toString() {
        return "Response{" +
                "code='" + code + '\'' +
                ", message='" + message + '\'' +
                '}';
    }
}
